<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
            text-align: center;
            margin: 200PX auto;
            border: 1px solid #000;
        }

        .nav {
            padding: 50px 20px;
        }

        .btn1 {
            margin: 10px 30px;
        }

        .btn2 {
            margin: 10px 30px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="head">
            <h3>
                每日一问
            </h3>
        </div>
        <div class="nav">
            问题是:
            <span class="content">
                ?x?=?
            </span>
        </div>
        <button class="btn1">开始</button>
        <button class="btn2">结束</button>
    </div>
    <script>
        const random1 = Math.floor(Math.random() * (10 - 1)) + 1
        const random2 = Math.floor(Math.random() * (10 - 1)) + 1
        // document.write(random1 + 'x' + random2)
        const span = document.querySelector('span')
        const btn1 = document.querySelector('.btn1')
        const btn2 = document.querySelector('.btn2')
        btn1.addEventListener('click', function () {

            span.innerText = random1 + 'x' + random2 + '=?'
        })
        btn2.addEventListener('click', function () {
            span.innerText = '答案是:' + random1 * random2
        })
    </script>
</body>

</html>